/*
To serve the rounding up purpose in Resampling method encapsuated in a class. 
Input: double
Output: rounded up int
*/
#include<math.h>

double cint(double x){
//	if (modf(x,0)>=.5)
	if (x - (int)x >= .5)
		return x>=0?ceil(x):floor(x);
	else
		return x<0?ceil(x):floor(x);
}
/*
double round(double r,unsigned places){
	double off=pow(10.0,places);
	return cint(r*off)/off;
}
*/

int roundup(double r){
	return (int)cint(r);
}

